# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgname=xorg-fonts-cyrillic
pkgver=1.0.4
pkgrel=1
pkgdesc="X.org cyrillic fonts"
arch=(any)
url="https://xorg.freedesktop.org/"
license=('custom')
depends=('xorg-fonts-alias-cyrillic')
makedepends=('xorg-util-macros' 'xorg-mkfontscale' 'xorg-bdftopcf')
source=(${url}/releases/individual/font/font-cronyx-cyrillic-${pkgver}.tar.xz{,.sig}
        ${url}/releases/individual/font/font-misc-cyrillic-${pkgver}.tar.xz{,.sig}
        ${url}/releases/individual/font/font-screen-cyrillic-1.0.5.tar.xz{,.sig}
        ${url}/releases/individual/font/font-winitzki-cyrillic-${pkgver}.tar.xz{,.sig})
sha512sums=('39c0bfc08ac746fd98a668d7545da503e8413d5d66cdb1884489ed7221fa4f09dad8dc997ca39595113e2f12fd65de6d2bfd8eaf1480aa93d5eb961d2e2f7cff'
            'SKIP'
            'fb2102805fedbd04b1533b85abcde79f432b97b72822bcfcdc09f525488d0d0c63815c8c25b79bab864bbe11fa1b72e2c34f5ba7b96eee1b6c84b841bb333353'
            'SKIP'
            '9f136fc6f6a3621c4b38302af5396789b1e6558b9b4b1b991624945eb9aac8497a6cd415460abc7dbcbaad1ef8ebd23cacfb3448c6e34cc9ba0726e7973c1a99'
            'SKIP'
            '11e366f96abe65aed9fb6fd087b2bd90af9f60548de0cebfeb348262860957a63a997616e00092d312b8ae9c262a7bb52da69c704a27d34018a45b98a87eb158'
            'SKIP')
validpgpkeys=('4A193C06D35E7C670FA4EF0BA2FB9E081F2D130E') # "Alan Coopersmith <alan.coopersmith@oracle.com>"

build() {
  cd "${srcdir}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      ./configure --prefix=/usr \
		      --with-fontdir=/usr/share/fonts/cyrillic
      make
      popd
    fi
  done
}

package() {
  install -m755 -d "${pkgdir}/usr/share/licenses/${pkgname}"
  cd "${srcdir}"
  for dir in *; do
    if [ -d "${dir}" ]; then
      pushd "${dir}"
      make DESTDIR="${pkgdir}" install
      install -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.${dir%-*}"
      popd
    fi    
  done
  rm -f "${pkgdir}"/usr/share/fonts/*/fonts.*
}
